*Code used to obtain SCF data directly from the SCF website

forv year = 1989(3)2019 { // ``modern'' SCF
	local yr = substr("`year'", 3, 2)

	copy "https://www.federalreserve.gov/econres/files/scfp`year's.zip" ///
		"$datadir/SCF/scf`year's.zip", replace
	di "33 `year'"
	unzipfile "$datadir/SCF/scf`year's.zip", replace
	rm scf`year's.zip
	
	if `year' < 2004 {
		copy "https://www.federalreserve.gov/econres/files/scf`yr's.zip" ///
			"$datadir/SCF/scf`yr's.zip", replace
		unzipfile "$datadir/SCF/scf`yr's.zip", replace
		rm scf`yr's.zip
	} 
	else {
		copy "https://www.federalreserve.gov/econres/files/scf`year's.zip" ///
			"$datadir/SCF/scf`year's.zip", replace
		unzipfile "$datadir/SCF/scf`year's.zip", replace
		rm scf`year's.zip	
	}
}